UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ys8lfCGAj1GbxmAFlp4UvEMAF/IpE0YhrzDyPrz3wqo=' 
WHERE 
  key_id = 'e5188f28ae239450ce3344edc5cd4ebf2915d3ae23d66aa2134d8952c37d1da9' 
  AND (
    token = 'ys8lfCGAj1GbxmAFlp4UvEMAF/IpE0YhrzDyPrz3wqo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042