UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'voltXdS4cxT1730Yh052gpGwhOsDHMld3aDcjF9yOnQ=' 
WHERE 
  key_id = 'c970ecdef688fa42d89cedee4b94abf964dc4a9e7eebea7c45b81b698db509a0' 
  AND (
    token = 'voltXdS4cxT1730Yh052gpGwhOsDHMld3aDcjF9yOnQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030