UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Zq8agYP/o0hz66wlnNnWkDmNVBPa3OAzntJkgpCXe58=' 
WHERE 
  key_id = 'f79c34d9637fce21d30a5f1820738fc27da5719b0d4f465b0c00342a486b7f15' 
  AND (
    token = 'Zq8agYP/o0hz66wlnNnWkDmNVBPa3OAzntJkgpCXe58=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057