UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'snTgbcdUPJ723/4jIDsI9t0aPJMAkh/G40nsiLW1Dfo=' 
WHERE 
  key_id = 'a41244e8ba26f702611d14ca4b65d4bf30f1593fd1f1a792350c3d6d73a0a6ff' 
  AND (
    token = 'snTgbcdUPJ723/4jIDsI9t0aPJMAkh/G40nsiLW1Dfo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055