UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uFKnpbUQ03BgOlq4aBUXibGXM9EwfpBhl0qsuZPWDhA='
WHERE
key_id = '7866140a11bd62b21b6ac365a63aea727959e9ba6336fce1041ab87f48161a68'
AND (
token = 'uFKnpbUQ03BgOlq4aBUXibGXM9EwfpBhl0qsuZPWDhA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)