UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cLALr+Z5Nit2Ad8Oxl6j4GUG+03+lMLIEep9xfK5VAM='
WHERE
key_id = '52d3c2b8af25cbefd92d5f23c72aecf76883a9111726079f9e86239610a99365'
AND (
token = 'cLALr+Z5Nit2Ad8Oxl6j4GUG+03+lMLIEep9xfK5VAM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)