UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lo520epKpnc3rNFcjO2ybDyLp/8qgEN1ydNpDKmjhnk=' 
WHERE 
  key_id = '4608dddb0413c7e9daaa9d4ee1cbf88b8988dd8779a081c97244f52e52850b08' 
  AND (
    token = 'lo520epKpnc3rNFcjO2ybDyLp/8qgEN1ydNpDKmjhnk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033