UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XONjim7j4LLlR6f5b5Hrffoxskc+apkBNuJqY+wMJfM='
WHERE
key_id = 'b7f35c4c8a48a64c3b656b7a9475d41ee6ae566995aa83698f1cea7596299d6a'
AND (
token = 'XONjim7j4LLlR6f5b5Hrffoxskc+apkBNuJqY+wMJfM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)