UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qEhPbMZuGYa+RD6VOLn7yaOgM0ldV2TpWH0kgMDRRwU='
WHERE
key_id = '22743d4bbf7033cebd544b5848f9254f2b1bbe90cbfcfc7d031027964039a0b4'
AND (
token = 'qEhPbMZuGYa+RD6VOLn7yaOgM0ldV2TpWH0kgMDRRwU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)