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