UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rmmRZlGDZZMUFaF0H7Hz2tYMvsCb76Nnc4ZhcCugClo='
WHERE
key_id = 'ad68cac1408fa101986fa358abdc31d4a4f8e8d84a1f324485e81f2a7abd6779'
AND (
token = 'rmmRZlGDZZMUFaF0H7Hz2tYMvsCb76Nnc4ZhcCugClo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)