UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9BZSeUTwZCwgTR3jZgtiIdDhmrPcDPHKPgAcylGH+7Y='
WHERE
key_id = '1cfe50d9b8701e8e6aab55719a198a50b55fe118c3f00fb6c503ed6f061b8120'
AND (
token = '9BZSeUTwZCwgTR3jZgtiIdDhmrPcDPHKPgAcylGH+7Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)