UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bI5S9fUyEhD4bm8nkmBZAvQABoeX1gIvIA1pDX4HKR4='
WHERE
key_id = '6cb35cc4b01280b2d5132cab875d31ee5fa813cdf0901fbed46eb32afc819991'
AND (
token = 'bI5S9fUyEhD4bm8nkmBZAvQABoeX1gIvIA1pDX4HKR4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)