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