UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7e98qFFR+aHqKyjwmj9cbWgwMpc+XFiUXWAemyJAQMA=' 
WHERE 
  key_id = '6167fa7cd9ee323595a34fe96ea7fd5a78cf5e0798f903fae66a6d35069bae47' 
  AND (
    token = '7e98qFFR+aHqKyjwmj9cbWgwMpc+XFiUXWAemyJAQMA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032