UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'il7EaDIPQvd1sBXz7Vvbr1d34/Ckg064shS4/hiNHcs='
WHERE
key_id = 'b9acf41c4f4d0473459bfb71886fabb1c6996215c132377aef52b9198ae3878e'
AND (
token = 'il7EaDIPQvd1sBXz7Vvbr1d34/Ckg064shS4/hiNHcs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)