UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mbwQFHSApa3i87qTgjJwLPLjnJuaTD+O6PitMj0u+Tc='
WHERE
key_id = 'e6ace0ade2b8f46cdce7a2e6cbe08398f3f91f5ffe096afc1b6b642d89fc0d54'
AND (
token = 'mbwQFHSApa3i87qTgjJwLPLjnJuaTD+O6PitMj0u+Tc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)