UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hUF8KLUg477Soc3mu6uHvtX1eYOrB6A+RSMAYGQLBmE='
WHERE
key_id = '7ec19e973eb8aaf25b3e2b8afa3686705bcaae1a9519a9df6cb4f648a7313f9b'
AND (
token = 'hUF8KLUg477Soc3mu6uHvtX1eYOrB6A+RSMAYGQLBmE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)