UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oEfSqNbtIc9BDpIIDGKTEiKlskQFp/9LVkcti2xAILc='
WHERE
key_id = '0982894d058d8905b176d172bf332c60502555f9f64ce4b8a542fb094622ca7e'
AND (
token = 'oEfSqNbtIc9BDpIIDGKTEiKlskQFp/9LVkcti2xAILc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)