UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xbxUeOnJ0U/t5HGKBCx7+OmJ72L3hB3UJT5eo6RY1ik=' 
WHERE 
  key_id = 'efe957c7b5466a11519f73a9b0f27fd80431b02f36a028adb697a9eaf2f877c7' 
  AND (
    token = 'xbxUeOnJ0U/t5HGKBCx7+OmJ72L3hB3UJT5eo6RY1ik=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023