UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZfleeiuAEzWaS+EJtQVd6j9enenzYwxxdJ1yjBDjGUs=' 
WHERE 
  key_id = '178e9b7f507c87044bb29769ab186f2149ed0ac245b69f3e0440896e19c16ffb' 
  AND (
    token = 'ZfleeiuAEzWaS+EJtQVd6j9enenzYwxxdJ1yjBDjGUs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017