UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't88mYHwKX+Tjg40vv2kVTL+kYDWSd93bRo7kjRENTjY=' 
WHERE 
  key_id = 'c55cfe2ad797cb4899eaffeac5d3ab0a23328baffac78632633f3aa49b9c4306' 
  AND (
    token = 't88mYHwKX+Tjg40vv2kVTL+kYDWSd93bRo7kjRENTjY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038