UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vm3MmVA6ReFgNe51ECKI2blvJErlNw3zW40N1ZG3/5Y='
WHERE
key_id = '43e13f8fb25bc1a49aa7e7a7848e17ddac37eea9ae367dedcf80d56baa747211'
AND (
token = 'vm3MmVA6ReFgNe51ECKI2blvJErlNw3zW40N1ZG3/5Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)