UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ABjhksJgPqxGr0EmT+6FN5sD+tKN/F7W/Vw2nWSgkLQ='
WHERE
key_id = '970d9e74ad002b14ac3ef6abcd6afd155ea00422ed2787eea34ac406f344a140'
AND (
token = 'ABjhksJgPqxGr0EmT+6FN5sD+tKN/F7W/Vw2nWSgkLQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)