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

Query time 0.00036