UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Sw8Pm8XL4TqD3m8i9GOV8lNhOTGt+hmb8ptKT1ppUcw='
WHERE
key_id = '32d4f02d57fcecdbe714b349cc76ae00e41d3f4b5de219e5fdd8e0f7148fec7b'
AND (
token = 'Sw8Pm8XL4TqD3m8i9GOV8lNhOTGt+hmb8ptKT1ppUcw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)