UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lHFY3vctZ65uu3seav3JlZfUTrJ3DCkM/Tl1TeuG+G4='
WHERE
key_id = '008ed19c22387b4bdcea7634da8adfbf6ed4ab56f5a4444b6c6504f7526cd7c2'
AND (
token = 'lHFY3vctZ65uu3seav3JlZfUTrJ3DCkM/Tl1TeuG+G4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)