UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n0vMfCTgreei6Pe54JZiedKYq63AkWtZ3uV00ovFOxY='
WHERE
key_id = 'b8d94303f21a817b5fa3fcc6ac9f06259077777bd44057d7588d2be0a9435c83'
AND (
token = 'n0vMfCTgreei6Pe54JZiedKYq63AkWtZ3uV00ovFOxY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)