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

Query time 0.00036