UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5uAXD9cquQ4AwJhWejplzoP9fLYszDl/EpnaPuourKU=' 
WHERE 
  key_id = '5b71c2d0bb545d5710f297ea877a97e6ab5a5a0cf1e854ff761978c5c7238c50' 
  AND (
    token = '5uAXD9cquQ4AwJhWejplzoP9fLYszDl/EpnaPuourKU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036