UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7A92bIvYU94d7Es2+pmxkwOA6bR7AkemuVvnBfExI5I='
WHERE
key_id = '77a94cf1e5bdf4e40e37abdc2b83c906d58cb2bc870389f8c05ae8c928c26624'
AND (
token = '7A92bIvYU94d7Es2+pmxkwOA6bR7AkemuVvnBfExI5I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)