UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ue3wQMb0/vh/x+MSJPQew6/kxFkC6UNoq5rypySFxHg=' 
WHERE 
  key_id = 'd2f695a4350182cdf9741fb9b45805baa624dcf0991bd106a8be4c1497b65edc' 
  AND (
    token = 'Ue3wQMb0/vh/x+MSJPQew6/kxFkC6UNoq5rypySFxHg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028