UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PCByZRYr8u8CsFWQmBSyTDMZiRRyMvds+tUAKIJKWpk='
WHERE
key_id = 'd1a750dc27c0a1b5f426384d8a764d8ec3e9814930a2b22a47964fabb681ff2d'
AND (
token = 'PCByZRYr8u8CsFWQmBSyTDMZiRRyMvds+tUAKIJKWpk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)