UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4lbTqY14ejjci9qKuV4NAK6HLZ0BElcmtgatljJQQQA='
WHERE
key_id = '1257a16a5f2a2ba1c204b6bbabf1f8627e1389549ec66d1998e8f77f27e99f98'
AND (
token = '4lbTqY14ejjci9qKuV4NAK6HLZ0BElcmtgatljJQQQA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)