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