UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MUzlLxkE0V1Z1cUfzR/DPO/iurwQsDiKMp1ZUr9SHd0=' 
WHERE 
  key_id = 'd0ce347702919e28893bfdee388f4ae7737bbac0f91c65da2ec4a74d737115b4' 
  AND (
    token = 'MUzlLxkE0V1Z1cUfzR/DPO/iurwQsDiKMp1ZUr9SHd0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021