UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jUodYHERRmMb0OZgs0EnOy4E61jIzMfUyt8CSzUVcDQ=' 
WHERE 
  key_id = '71f73dac95137cd4a60ae75fb57d98e28b16fe418c16a33fb77747161b8a2df9' 
  AND (
    token = 'jUodYHERRmMb0OZgs0EnOy4E61jIzMfUyt8CSzUVcDQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021