UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'szon6Plh4A+14HYid3X5g7m4gi2laPPy5QeMjhBIQhk=' 
WHERE 
  key_id = 'a4029e30bf3992b7b9436ea0aa226598d3c2cb4e91108f98c6ad2f83839d1b18' 
  AND (
    token = 'szon6Plh4A+14HYid3X5g7m4gi2laPPy5QeMjhBIQhk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044